<?php
namespace app\index\controller;
use think\Controller;
class Base extends Controller
{
    public function _initialize()
    {
        $cateList = db('cate')->order('id asc')->select();
        // 获取右侧的热门点击
        $hotclick = db('article')->order('click desc')->select();
        // 推荐阅读
        $recommend = db('article')->where('state',1)->order('click desc')->select();
        $this->assign(array(
            'catelist'=>$cateList,
            'hotclick'=> $hotclick,
            'recommend'=> $recommend
        ));
    }
}
